const {createMysqlConnect} = require('../db/mysql');

const node = createMysqlConnect('node');

node.connect(() => {
  console.log('连接成功');
});

exports.getAllUser = (sql) => {
  return new Promise((resolve, reject) => {
    node.query(sql, (err, r) => {
      if (err) {
        reject(err);
      }
      resolve(r);
    });
  })
};

module.default = node;